package com.gimi.cloud.jimi.app.consumer.feign.hystrix;

import com.gimi.cloud.jimi.app.consumer.feign.product.ProductFeignService;
import com.gimi.cloud.jimi.common.enums.ResponseCodeEnum;
import com.gimi.cloud.jimi.common.utils.JsonUtil;
import com.gimi.cloud.jimi.common.utils.reqhead.Response;
import com.gimi.cloud.jimi.dto.product.ProductDto;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * productDetail熔断
 * @author chendi
 * @date 2018年1月9日
 */
@Component
public class ProductDetalHystrix implements ProductFeignService{
    private static Logger logger = LoggerFactory.getLogger(ProductDetalHystrix.class);

	@Override
	public String getProductDetail(ProductDto params) {
		logger.error("===>熔断返回");
		Response resp = new Response();
		resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
		return JsonUtil.toJson(resp);
	}

	@Override
	public String getProductProp(ProductDto params) {
		logger.error("===>熔断返回");
		Response resp = new Response();
		resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
		return JsonUtil.toJson(resp);
	}

	@Override
	public String getModelValueList(ProductDto params) {
		logger.error("===>熔断返回");
		Response resp = new Response();
		resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
		return JsonUtil.toJson(resp);
	}
}
